package com.edu.exam.entity.examination.paper.technical;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import jakarta.persistence.*;
import java.time.LocalDateTime;
import com.edu.exam.enums.examination.paper.EngineType;

/**
 * 识别引擎配置实体类
 * 所属模块：E-01 考试执行模块
 * 对应数据库表：recognition_engine
 *
 * <p>根据E-04-01设备适配子模块数据库设计实现，
 * 存储识别引擎的配置信息。用于管理OMR识别、图像处理等技术引擎的配置参数。</p>
 *
 * @author System
 * @version 1.0.0
 */

@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class RecognitionEngine {

    /**
     * 引擎ID，主键
     */
    @Id
    @Column(name = "engine_id", length = 64)
    private String engineId;

    /**
     * 引擎名称
     */
    @Column(name = "engine_name", length = 128, nullable = false)
    private String engineName;

    /**
     * 引擎类型
     */
    @Enumerated(EnumType.STRING)
    @Column(name = "engine_type", length = 32, nullable = false)
    private EngineType engineType;

    /**
     * 引擎版本
     */
    @Column(name = "engine_version", length = 32, nullable = false)
    private String engineVersion;

    /**
     * 引擎配置
     */
    @Column(name = "engine_config", columnDefinition = "TEXT")
    private String engineConfig;

    /**
     * 是否启用
     */
    @Column(name = "is_enabled")
    private Boolean isEnabled;

    /**
     * 优先级
     */
    @Column(name = "priority")
    private Integer priority;

    /**
     * 创建时间
     */
    @CreationTimestamp
    @Column(name = "created_time", nullable = false, updatable = false)
    private LocalDateTime createdTime;

    /**
     * 更新时间
     */
    @UpdateTimestamp
    @Column(name = "updated_time", nullable = false)
    private LocalDateTime updatedTime;

    /**
     * 版本号
     */
    @Version
    @Column(name = "version", nullable = false)
    private Long version = 0L;

    /**
     * 是否删除
     */
    @Column(name = "is_deleted", nullable = false)
    private Boolean isDeleted = false;

}